function [ index ] = Umap( i,j )
% Returns index on Velocity matrix for 1:2 expansion problem
% Inputs:
% i: index denotes spacial X position
% j: index denotes Y spatial position
%
% By GDA
% Reviewed by GDMT.

global NIt
global NJt
global NIe
global NJe

NIut = NIt+1;
NJut = NJt;
NIue = NIe;
NJue = NJe;


if ( j <= NJue )
    % Located below expansion
    index = i + (j-1) * NIut;
else
    % Located above expansion
    block1 = NIut*(NJue);
    is = i-NIue;
    js = j-NJue;
    index = block1 + is + (NIut-NIue) * (js-1);
    if (is<1 || js<1)
        error = 'OUT OF BOUNDS UIJ'
    end
end




end

